home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form frmWorkflow
- Appearance = 0 'Flat
- BackColor = &H00FFFFFF&
- Caption = "Example 1: WorkFlow"
- ClientHeight = 3675
- ClientLeft = 450
- ClientTop = 1530
- ClientWidth = 5445
- FillColor = &H0080FFFF&
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 4080
- Left = 390
- LinkTopic = "Form1"
- MDIChild = -1 'True
- ScaleHeight = 3675
- ScaleWidth = 5445
- Tag = "1"
- Top = 1185
- Width = 5565
- Begin VB.PictureBox Picture9
- Appearance = 0 'Flat
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 585
- Left = 3540
- Picture = "Workflow.frx":0000
- ScaleHeight = 555
- ScaleWidth = 555
- TabIndex = 2
- Top = 90
- Visible = 0 'False
- Width = 585
- End
- Begin VB.PictureBox Picture11
- Appearance = 0 'Flat
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 585
- Left = 4770
- Picture = "Workflow.frx":030A
- ScaleHeight = 555
- ScaleWidth = 585
- TabIndex = 1
- Top = 90
- Visible = 0 'False
- Width = 615
- End
- Begin VB.PictureBox Picture10
- Appearance = 0 'Flat
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 585
- Left = 4140
- Picture = "Workflow.frx":0614
- ScaleHeight = 555
- ScaleWidth = 585
- TabIndex = 0
- Top = 90
- Visible = 0 'False
- Width = 615
- End
- Begin AddFlowLib.AddFlow AddFlow1
- Height = 3405
- Left = 270
- TabIndex = 3
- Top = 180
- Width = 3270
- _Version = 65536
- _ExtentX = 5768
- _ExtentY = 6006
- _StockProps = 101
- BackColor = 16777152
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Arial"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- BorderStyle = 1
- ScrollBars = 3
- Shape = 0
- LinkStyle = 0
- Alignment = 7
- AutoSize = 0
- ArrowDst = 3
- ArrowOrg = 0
- DrawStyle = 0
- DrawWidth = 1,4013e-45
- ReadOnly = 0 'False
- MultiSel = -1 'True
- CanDrawNode = -1 'True
- CanDrawLink = -1 'True
- CanMoveNode = -1 'True
- CanSizeNode = -1 'True
- CanStretchLink = -1 'True
- CanMultiLink = -1 'True
- Transparent = 0 'False
- ShowGrid = 0 'False
- Hidden = 0 'False
- Rigid = 0 'False
- DisplayHandles = -1 'True
- AutoScroll = -1 'True
- xGrid = 7,00649e-45
- yGrid = 7,00649e-45
- xZoom = 100
- yZoom = 100
- FillColor = 16777215
- DrawColor = 0
- ForeColor = 0
- BackPicture = "Workflow.frx":091E
- End
- Attribute VB_Name = "frmWorkflow"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Sub CursorShape(AddFlow1 As Control)
- With AddFlow1
- Dim area%
- area = .PointedArea
- Select Case area
- Case 0
- .MousePointer = 8
- Case 1
- .MousePointer = 7
- Case 2
- .MousePointer = 6
- Case 3
- .MousePointer = 9
- Case 7
- If .SelectMode = True Then
- .MousePointer = 2
- Else
- .MousePointer = 0
- End If
- End Select
- End With
- End Sub
- Private Sub AddFlow1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Me.SetFocus
- End Sub
- Private Sub AddFlow1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
- Dim nodx As afNode
- If AddFlow1.LastUserAction() = 1 Then ' Node creation
- Set nodx = AddFlow1.SelectedNode
- If Not (nodx Is Nothing) Then
- nodx.UserData = 2
- End If
- End If
- End Sub
- Private Sub Form_Activate()
- frmMain.ActivateForm
- End Sub
- Private Sub Form_Deactivate()
- frmMain.DeactivateForm
- End Sub
- Private Sub Form_Load()
- frmMain.ShowExample(0).Enabled = False
- Dim nodx As afNode, lnkx As afLink
- Dim crlf$
- crlf = Chr$(13) + Chr$(10)
- With AddFlow1
- .Left = 0
- .Top = 0
- ' Just to accelerate display (Don't forget to reset it at the end)
- .Repaint = False
- .DrawColor = 32768
- ' Create nodes
- Set nodx = .Nodes.Add(1050, 60, 1300, 960) ' Node 1
- nodx.FillColor = RGB(255, 255, 192)
- nodx.Text = "Order Entry"
- Set nodx.Picture = Picture11.Picture
- Set nodx = .Nodes.Add(1470, 1570, 450, 450) ' Node 2
- nodx.FillColor = 16777215
- nodx.Text = "and"
- Set nodx = .Nodes.Add(1425, 4815, 415, 480) ' Node 3
- nodx.FillColor = 16777215
- Set nodx = .Nodes.Add(100, 3285, 1115, 525) ' Node 4
- nodx.Shape = afRoundRect
- nodx.FillColor = 8454143
- nodx.Text = "Inventory Check"
- Set nodx = .Nodes.Add(2070, 2700, 1275, 465) ' Node 5
- nodx.Shape = afRoundRect
- nodx.FillColor = 8454143
- nodx.Text = "Compile Reference"
- Set nodx = .Nodes.Add(2070, 3960, 1275, 435) ' Node 6
- nodx.Shape = afRoundRect
- nodx.FillColor = 8454143
- nodx.Text = "Evaluate Reference"
- Set nodx = .Nodes.Add(2460, 4800, 480, 480) ' Node 7
- nodx.Shape = afDiamond
- nodx.FillColor = 12632256
- nodx.Text = "or"
- Set nodx = .Nodes.Add(1380, 6390, 480, 480) ' Node 8
- nodx.Shape = afDiamond
- nodx.FillColor = 12632256
- nodx.Text = "or"
- Set nodx = .Nodes.Add(1050, 5620, 1150, 530) ' Node 9
- nodx.Shape = afRoundRect
- nodx.FillColor = 8454143
- nodx.Text = "Order Evaluation"
- Set nodx = .Nodes.Add(30, 7275, 1365, 915) ' Node 10
- nodx.Shape = afRoundRect
- nodx.FillColor = 8454143
- nodx.Text = "Letter of regret"
- Set nodx.Picture = Picture9.Picture
- Set nodx = .Nodes.Add(2010, 7425, 1185, 390) ' Node 11
- nodx.Shape = afRoundRect
- nodx.FillColor = 8454143
- nodx.Text = "Billing"
- Set nodx = .Nodes.Add(2025, 8310, 1170, 375) ' Node 12
- nodx.Shape = afRoundRect
- nodx.FillColor = 8454143
- nodx.Text = "Shipping"
- Set nodx = .Nodes.Add(1380, 10005, 1110, 915) ' Node 13
- nodx.DrawColor = 32768
- nodx.FillColor = RGB(255, 255, 192)
- nodx.Text = "Archive"
- Set nodx.Picture = Picture10.Picture
- .Shape = afRoundRect
- .DrawColor = RGB(0, 0, 0)
- Set nodx = .Nodes.Add(45, 1135, 1215, 640) ' Node 14
- nodx.Transparent = -1
- nodx.UserData = 2
- nodx.FillColor = 15269887
- nodx.Text = "Jane" + crlf + "INVENTORY MANAGER"
- Set nodx = .Nodes.Add(3000, 610, 1075, 525) ' Node 15
- nodx.Transparent = -1
- nodx.UserData = 2
- nodx.FillColor = 15269887
- nodx.Text = "Paul" + crlf + "SECRETARY"
- Set nodx = .Nodes.Add(3000, 5640, 1100, 480) ' Node 16
- nodx.Transparent = -1
- nodx.UserData = 2
- nodx.FillColor = 15269887
- nodx.Text = "Lydia" + crlf + "SECRETARY"
- Set nodx = .Nodes.Add(4000, 7770, 600, 540) ' Node 17
- nodx.DrawStyle = afDot
- nodx.Transparent = -1
- nodx.UserData = 2
- nodx.FillColor = 15269887
- nodx.Text = "Bill"
- Set nodx = .Nodes.Add(105, 9030, 945, 600) ' Node 18
- nodx.Transparent = -1
- nodx.UserData = 2
- nodx.FillColor = 15269887
- nodx.Text = "Jack" + crlf + "ARCHIVER"
- .DrawColor = 32768
- ' Create links
- Set lnkx = .Nodes(1).OutLinks.Add(.Nodes(2))
- Set lnkx = .Nodes(2).OutLinks.Add(.Nodes(4))
- Dim pt As New afLinkPoint
- pt.X = 795
- pt.Y = 2130
- lnkx.ExtraPoints.Add pt
- Set lnkx = .Nodes(5).OutLinks.Add(.Nodes(6))
- Set lnkx = .Nodes(4).OutLinks.Add(.Nodes(3))
- pt.X = 795
- pt.Y = 5040
- lnkx.ExtraPoints.Add pt
- Set lnkx = .Nodes(6).OutLinks.Add(.Nodes(7))
- Set lnkx = .Nodes(7).OutLinks.Add(.Nodes(3))
- lnkx.Text = "Yes"
- Set lnkx = .Nodes(3).OutLinks.Add(.Nodes(9))
- Set lnkx = .Nodes(9).OutLinks.Add(.Nodes(8))
- Set lnkx = .Nodes(8).OutLinks.Add(.Nodes(10))
- pt.X = 705
- pt.Y = 6795
- lnkx.ExtraPoints.Add pt
- lnkx.Text = "Reject"
- Set lnkx = .Nodes(8).OutLinks.Add(.Nodes(11))
- pt.X = 2595
- pt.Y = 6795
- lnkx.ExtraPoints.Add pt
- lnkx.Text = "Accept"
- Set lnkx = .Nodes(11).OutLinks.Add(.Nodes(12))
- Set lnkx = .Nodes(12).OutLinks.Add(.Nodes(13))
- lnkx.DrawColor = 32768
- Set lnkx = .Nodes(10).OutLinks.Add(.Nodes(13))
- lnkx.DrawColor = 32768
- Set lnkx = .Nodes(2).OutLinks.Add(.Nodes(5))
- pt.X = 2700
- pt.Y = 2115
- lnkx.ExtraPoints.Add pt
- Set lnkx = .Nodes(7).OutLinks.Add(.Nodes(5))
- pt.X = 4020
- pt.Y = 5040
- lnkx.ExtraPoints.Add pt
- pt.X = 4020
- pt.Y = 2925
- lnkx.ExtraPoints.Add pt
- lnkx.Text = "No"
- ' Default properties for the end
- .DrawWidth = 1
- .DrawColor = RGB(0, 0, 0)
- .Shape = afRoundRect
- .ArrowDst = afEmptyCircle
- .ArrowOrg = afEmptyCircle
- .Transparent = True
- .LinkStyle = afBezier
- ' Now continue
- Set lnkx = .Nodes(14).OutLinks.Add(.Nodes(1))
- Set lnkx = .Nodes(15).OutLinks.Add(.Nodes(5))
- Set lnkx = .Nodes(15).OutLinks.Add(.Nodes(6))
- pt.X = 4515
- pt.Y = 2560
- lnkx.ExtraPoints.Add pt
- pt.X = 4200
- pt.Y = 3000
- lnkx.ExtraPoints.Add pt
- Set lnkx = .Nodes(14).OutLinks.Add(.Nodes(4))
- pt.X = 450
- pt.Y = 2460
- lnkx.ExtraPoints.Add pt
- Set lnkx = .Nodes(16).OutLinks.Add(.Nodes(9))
- Set lnkx = .Nodes(17).OutLinks.Add(.Nodes(11))
- lnkx.DrawStyle = afDot
- Set lnkx = .Nodes(17).OutLinks.Add(.Nodes(12))
- lnkx.DrawStyle = afDot
- Set lnkx = .Nodes(18).OutLinks.Add(.Nodes(10))
- Set lnkx = .Nodes(18).OutLinks.Add(.Nodes(13))
- .Repaint = True
- End With
- End Sub
- Private Sub Form_Resize()
- If WindowState <> 1 And ScaleHeight <> 0 Then
- AddFlow1.Height = ScaleHeight
- AddFlow1.Width = ScaleWidth
- End If
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- frmMain.ShowExample(0).Enabled = True
- End Sub
- Private Sub AddFlow1_DblClick()
- Dim nodx As afNode, s$
- Set nodx = AddFlow1.SelectedNode
- If nodx Is Nothing Then Exit Sub
- If nodx.UserData = 2 Then
- s = frmTask.Display(nodx.Text)
- If s <> "-1" Then '!!
- nodx.Text = s
- End If
- End If
- End Sub
- Private Sub AddFlow1_KeyDown(KeyCode As Integer, Shift As Integer)
- Const KEY_DELETE = &H2E
- If KeyCode = KEY_DELETE Then
- AddFlow1.DeleteSel
- End If
- End Sub
- Private Sub AddFlow1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- CursorShape AddFlow1
- End Sub
-